package com.mathdroid.model.simulation;

import java.io.Serializable;

/**
 * This contains statistics about an ability. Those statistics result from
 * simulations.
 */
public final class AbilityStatistics implements Serializable {

	/**
	 * Generated UID.
	 */
	private static final long serialVersionUID = -3850218462649919089L;
	
	/**
	 * The amount of critical strikes.
	 */
	private int crits = 0;
	/**
	 * The amount of hits.
	 */
	private int hits = 0;
	/**
	 * The amount of misses/resists.
	 */
	private int misses = 0;
	/**
	 * The total direct damage done.
	 */
	private double directDamage = 0d;
	/**
	 * The total direct healing done.
	 */
	private double directHealing = 0d;
	/**
	 * The total periodic damage done.
	 */
	private double periodicDamage = 0d;
	/**
	 * The total periodic healing done.
	 */
	private double periodicHealing = 0d;
	
	/**
	 * The uses of the ability.
	 */
	private double uses = 0d;
	
	/**
	 * The cost of this ability.
	 */
	private double costs = 0d;
	
	/**
	 * Add direct damage.
	 * @param d Direct damage.
	 */
	public void addDirectDamage(final double d) {
		this.directDamage += d;
	}
	
	/**
	 * Add direct healing.
	 * @param h Direct healing.
	 */
	public void addDirectHealing(final double h) {
		this.directHealing += h;
	}
	
	/**
	 * Add periodic damage.
	 * @param d Periodic damage.
	 */
	public void addPeriodicDamage(final double d) {
		this.periodicDamage += d;
	}
	
	/**
	 * Add periodic healing.
	 * @param h Periodic healing.
	 */
	public void addPeriodicHealing(final double h) {
		this.periodicHealing += h;
	}
	
	/**
	 * Increase use counter.
	 */
	public void addUse() {
		this.uses++;
	}

	/**
	 * Add an crit.
	 */
	public void addCrit() {
		this.crits++;
	}
	
	/**
	 * Add an hit.
	 */
	public void addHit() {
		this.hits++;
	}
	
	/**
	 * Add an miss.
	 */
	public void addMiss() {
		this.misses++;
	}
	
	/**
	 * Add costs.
	 * @param d The costs to add.
	 */
	public void addCosts(final double d) {
		this.costs += d;
	}
	
	/**
	 * Add uses.
	 * @param d The uses to add.
	 */
	public void addUses(final double d) {
		this.uses += d;
	}
	
	/**
	 * Add crits.
	 * @param d The crits to add.
	 */
	public void addCrits(final double d) {
		this.crits += d;
	}
	
	/**
	 * Add hits.
	 * @param d The hits to add.
	 */
	public void addHits(final double d) {
		this.hits += d;
	}
	
	/**
	 * Add misses.
	 * @param d The misses to add.
	 */
	public void addMisses(final double d) {
		this.misses += d;
	}
	
	/* ************************** GETTERS / SETTERS ***************************/

	/**
	 * @return the crits
	 */
	public int getCrits() {
		return crits;
	}

	/**
	 * @param c the crits to set
	 */
	public void setCrits(final int c) {
		this.crits = c;
	}

	/**
	 * @return the hits
	 */
	public int getHits() {
		return hits;
	}

	/**
	 * @param h the hits to set
	 */
	public void setHits(final int h) {
		this.hits = h;
	}

	/**
	 * @return the misses
	 */
	public int getMisses() {
		return misses;
	}

	/**
	 * @param m the misses to set
	 */
	public void setMisses(final int m) {
		this.misses = m;
	}

	/**
	 * @return the directDamage
	 */
	public double getDirectDamage() {
		return directDamage;
	}

	/**
	 * @param d the directDamage to set
	 */
	public void setDirectDamage(final double d) {
		this.directDamage = d;
	}

	/**
	 * @return the directHealing
	 */
	public double getDirectHealing() {
		return directHealing;
	}

	/**
	 * @param d the directHealing to set
	 */
	public void setDirectHealing(final double d) {
		this.directHealing = d;
	}

	/**
	 * @return the periodicDamage
	 */
	public double getPeriodicDamage() {
		return periodicDamage;
	}

	/**
	 * @param p the periodicDamage to set
	 */
	public void setPeriodicDamage(final double p) {
		this.periodicDamage = p;
	}

	/**
	 * @return the periodicHealing
	 */
	public double getPeriodicHealing() {
		return periodicHealing;
	}

	/**
	 * @param p the periodicHealing to set
	 */
	public void setPeriodicHealing(final double p) {
		this.periodicHealing = p;
	}

	/**
	 * @return the uses
	 */
	public double getUses() {
		return uses;
	}

	/**
	 * @param u the uses to set
	 */
	public void setUses(final double u) {
		this.uses = u;
	}

	/**
	 * @return the costs
	 */
	public double getCosts() {
		return costs;
	}

	/**
	 * @param c the costs to set
	 */
	public void setCosts(final double c) {
		this.costs = c;
	}
}
